package com.petalsgroup.petals.dao.reason.impl;

import com.petalsgroup.petals.dao.reason.ReasonDao;
import com.petalsgroup.petals.pojo.CommentsDO;
import com.petalsgroup.petals.pojo.ReasonDO;
import com.petalsgroup.petals.util.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class ReasonDaoImpl implements ReasonDao {
    private JdbcTemplate template=new JdbcTemplate(JDBCUtils.getDataSource());

    /**
     * 获取举报理由
     * @return
     * @author wgd
     */
    @Override
    public List<ReasonDO> getAllReason() {
        String sql="select * from reason ";
        List<ReasonDO> reason = template.query(sql, new BeanPropertyRowMapper<>(ReasonDO.class));
        return reason;
    }
}
